package com.example.administrator.testz.Adapter;/**
 * Created by Administrator on 2016/3/16.
 */

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

import com.example.administrator.testz.News.NewsBean;
import com.example.administrator.testz.R;

import java.util.ArrayList;
import java.util.List;

/**
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>类描述
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>属性描述
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>方法描述
 */
public class TextActivity extends Activity {

    private ListView listView;
    private TestAdapter adatpter;
    private List<NewsBean> list = new ArrayList<NewsBean>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        listView = (ListView) findViewById(R.id.listView1);
        for (int i = 0; i < 5; i++){
            NewsBean bean = new NewsBean();
            bean.setmContent("文本内容：" + i + "-" + i);
            bean.setmTitle("标题：" + i);
            list.add(bean);
        }

        adatpter = new TestAdapter(list, getApplicationContext(), R.layout.row_test);
        listView.setAdapter(adatpter);
    }
}
